/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.liycloud.gateway.config;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * @date 2018/7/22  网关不校验终端配置
 *
 *  配置文件里的ignore属性不为空时会生效。 而验证码过滤器会对  FilterIgnorePropertiesConfig  中配置的客户端进行放行
 *
 *  这里配置的 ignore 客户端,  在gateway网关的验证码过滤器 ValidateCodeGatewayFilter 中会直接放行
 *
 */
@Data
@Configuration
@RefreshScope
@ConditionalOnExpression(" !'${ignore}'.isEmpty() ")  // 条件表达式: ignore 配置节点不为空
@ConfigurationProperties(prefix = "ignore")
public class FilterIgnorePropertiesConfig {

	private List<String> clients = new ArrayList<>();

	private List<String> swaggerProviders = new ArrayList<>();

}
